# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/crossover-office-pro-bin/crossover-office-pro-bin-9.2.0.ebuild,v 1.1 2011/03/01 02:51:37 vapier Exp $

EAPI="2"

inherit eutils

DESCRIPTION="simplified/streamlined version of wine with commercial support"
HOMEPAGE="http://www.codeweavers.com/products/cxoffice/"
DOWN_URL="http://ftp.codeweavers.com/pub/crossover/cxlinux/demo"
SRC_URI="amd64? ( ${DOWN_URL}/ia32-crossover-pro-demo_${PV}-1_amd64.deb )
	x86? ( ${DOWN_URL}/crossover-pro-demo_${PV}-1_i386.deb )"

LICENSE="CROSSOVER"
SLOT="0"
KEYWORDS="-* ~amd64 ~x86"
IUSE="nas"
RESTRICT="strip"

RDEPEND="sys-libs/glibc
	x11-libs/libXrandr
	x11-libs/libXi
	x11-libs/libXmu
	x11-libs/libXxf86dga
	x11-libs/libXxf86vm
	dev-util/desktop-file-utils
	nas? ( media-libs/nas )
	amd64? ( app-emulation/emul-linux-x86-xlibs )
	media-libs/jpeg:62
	media-libs/libpng:1.2"

S=${WORKDIR}
src_unpack() { 
	#unpack_makeself ${A}
	unpack ${A}
	unpack ./data.tar.gz
}
src_install() {
	cp -r * "${D}" || die "cp failed"
	rm -r "${D}"/{control,data}.tar.gz
	rm -r "${D}"/debian-binary
}

pkg_postinst() {
	elog "Run /opt/cxoffice/bin/cxsetup as normal user to create"
	elog "bottles and install Windows applications."

	echo "Creating menu's and file associations, please wait..."
	/opt/cxoffice/bin/cxmenu --crossover --install
	/opt/cxoffice/bin/cxassoc --crossover --install
	echo "Done!"
	echo
}
pkg_postupgrade() {
	post_install
}